@extends('admin/layouts/admin')
@section('title', '广告位')
@section('main')
<div class="main-title"><h2>@if (!empty($data)) 编辑@else添加@endif广告位</h2></div>
<div class="main-section">
  <div style="width: 543px">
    <form action="{{ url('/adv/save') }}" method="post">
      <div class="form-group row">
        <label class="col-sm-3 col-form-label">广告位名称</label>
        <div class="col-sm-9">
          <input type="text" name="name" class="form-control" @if (!empty($data)) value="{{ $data->name }}" @endif style="width:200px">
        </div>
      </div>
      <div class="form-group row">
        <div class="col-sm-10">
          {{ csrf_field() }}
          @if (!empty($data))
          <input type="hidden" name="id" value="{{ $data->id }}">
          @endif
          <button type="submit" class="btn btn-primary mr-2">提交表单</button>
          <a href="{{ url('adv') }}" class="btn btn-secondary">返回列表</a>
        </div>
      </div>
    </form>
  </div>
</div>
<script>
  main.menuActive('adv');
</script>
@endsection